{% extends "common/layout_main.html" %}
{% block content %}
<div class="row  border-bottom">
    <div class="col-lg-12">
        <div class="tab_title">
            <ul class="nav nav-pills">
                <li>
                    <a href="{{ url_for('member_page.index') }}">会员列表</a>
                </li>
                <li class="current">
                    <a href="{{ url_for('member_page.comment') }}">会员评论</a>
                </li>
            </ul>
        </div>
    </div>
</div>
<div class="row">
    <div class="col-lg-12">
        <table class="table table-bordered m-t">
            <thead>
            <tr>
                <th>头像</th>
                <th>姓名</th>
                <th>美餐</th>
                <th>评论内容</th>
                <th>打分</th>
            </tr>
            </thead>
            <tbody>
                {%  if pagination.comments %}
                {% for item in pagination.comments %}
            <tr>
                <td>
                    <img alt="image" class="img-circle" src="/static/images/member/{{item.member_img}}" style="width: 40px;height: 40px;">
                </td>
                <td>{{ item.member_nickname }}</td>
                <td>{{ item.food }}</td>
                <td>{{ item.content }}</td>
                <td>{{ item.score }}</td>
            </tr>
             {% endfor %}
            {% else %}
                <tr><td colspan="5">暂无数据</td></tr>
            {% endif %}
            </tbody>
        </table>
        <!--分页代码-->
        <div class="row">
            <div class="col-lg-12">
                <span class="pagination_count" style="line-height: 40px;">共{{ pagination.totals }}条数据 | {{ pagination.total_pages }}页</span>
                <ul class="pagination pagination-sm no-margin pull-right">
                <li><a href="{{ url_for('member_page.comment') }}?page={{ pagination.prev_page }}">&laquo;</a></li>
                {% if pagination.total_pages <= 15 %}
                    {% for k in pagination.page_range %}
                        {% if pagination.current_page == k %}
                        <li class="active"><a href="{{ url_for('member_page.comment') }}?page={{ k }}">{{ k }}</a></li>
                        {% else %}
                        <li><a href="{{ url_for('member_page.comment') }}?page={{ k }}">{{ k }}</a></li>
                        {% endif %}
                    {% endfor %}
                {% else %}
                        <li><a href="javascript:void(0);">...</a></li>
                {% endif %}
                <li><a href="{{ url_for('member_page.comment') }}?page={{ pagination.next_page }}">&raquo;</a></li>
              </ul>
            </div>
        </div>
    </div>
</div>
{% endblock %}
